/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

/**
 *
 * @author Andy
 */
@Entity(name = "Batch")
public class BatchEntity extends DataObjectEntity implements Serializable {

    @ManyToOne
    private ProductEntity product;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date expiryDate;
      @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateEntered;
    @OneToOne(mappedBy = "batch", cascade = {CascadeType.ALL})
    private DisposalEntity disposal;
    int quantity;
    @OneToOne (mappedBy="batch", cascade = {CascadeType.ALL})
    private InventoryEntity inventory;
    int unassignedCases;
    int unassignedKg;
    int amountLeftForFulfilment;
    private String type;
    
    
    public BatchEntity() {
        super();
    }

    public int getAmountLeftForFulfilment() {
        return amountLeftForFulfilment;
    }

    public void setAmountLeftForFulfilment(int amountLeftForFulfilment) {
        this.amountLeftForFulfilment = amountLeftForFulfilment;
    }

    public Date getDateEntered() {
        return dateEntered;
    }

    public void setDateEntered(Date dateEntered) {
        this.dateEntered = dateEntered;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getUnassignedKg() {
        return unassignedKg;
    }

    public void setUnassignedKg(int unassignedKg) {
        this.unassignedKg = unassignedKg;
    }

    public int getUnassignedCases() {
        return unassignedCases;
    }

    public void setUnassignedCases(int unassignedCases) {
        this.unassignedCases = unassignedCases;
    }

    public InventoryEntity getInventory() {
        return inventory;
    }

    public void setInventory(InventoryEntity inventory) {
        this.inventory = inventory;
    }

    public DisposalEntity getDisposal() {
        return disposal;
    }

    public void setDisposal(DisposalEntity disposal) {
        this.disposal = disposal;
    }

    public Date getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    public ProductEntity getProduct() {
        return product;
    }

    public void setProduct(ProductEntity product) {
        this.product = product;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public String childToString() {
        return "BatchEntity{" + "product=" + product + ", expiryDate=" + expiryDate + ", disposal=" + disposal + ", quantity=" + quantity + ", inventory=" + inventory + '}';
    }
    
}
